1. Field of the Invention
The present invention relates to a method for detecting a size of a document and an image reading apparatus for reading an image on a document placed on a document table, and more particularly to a processing technique for calculating a size of the document based on image data thus read.
2. Description of Related Art
When the image reading apparatus reads the image on the document, first, the document is placed on a contact glass (placing surface) provided on the document table. At this time, the document is placed on the contact glass, so that an image-recorded surface faces the contact glass. Next, a document cover is closed. As a result, the document is sandwiched between a pressing surface of the document cover and the contact glass, thereby being fixed on the contact glass. In this state, when a reading instruction is inputted to the image reading apparatus, the image on the document is read by an image sensor disposed so as to face the document through the contact glass.
As such an image reading apparatus, the one having a function to detect the size of the document placed on the contact glass is well known. As a detection technique of a document size, for example, there is a method disclosed in Japanese Patent Application Laid-Open No. 2000-232562. Namely, in the image reading apparatus disclosed in Japanese Patent Application Laid-Open No. 2000-232562, a document cover having a particular pattern drawn on the pressing surface is provided. The image sensor reads the image, with the document pressed by this document cover. Then, by detecting portions corresponding to the aforementioned pattern from the image data read by the image sensor, the size of the document is detected. However, in this detection technique, when the image on a transparent or semi-transparent document is read, the pattern drawn on the pressing surface of the document cover is also simultaneously read by the image sensor. Therefore, in some cases, the size of the transparent or semi-transparent document can not be detected. Meanwhile, Japanese Patent Application Laid-Open No. 2001-66712 discloses the image reading apparatus capable of detecting the size of the document without a deterioration of an image quality for either document of the transparent or semi-transparent document.
In the image reading apparatus disclosed in Japanese Patent Application Laid-Open No. 2001-66712, a document table is adopted, which has a belt-shaped pattern provided so as to overlap with an image non-forming area of the document when the document is placed on the contact glass. The image non-forming area is subjected to image reading, but image data read therefrom is not used for image forming. The document is inserted and placed between the contact glass and the aforementioned pattern, and in this state, the image of the document is read. Then, by determining whether or not the aforementioned pattern is included in the image data thus read, an edge of the document is detected, and the size of the document is thereby recognized.
However, in the conventional detection method of the document size disclosed in the above-described Japanese Patent Application Laid-Open No. 2001-66712, the size of the document is detected using only one belt-shaped pattern. Accordingly, for example, when the document has a background similar to the belt-shaped pattern, it is impossible to discriminate between a margin of the edge portion of the document and the belt-shaped pattern included in the read image data, thus making it impossible to recognize the document size.